<template>
  <zm-view ref="view">
    <view class="p-24">
      <zm-richtext :content="content"></zm-richtext>
    </view>
  </zm-view>
</template>

<script>
import page from "@/mixins/page"
import hook from "@/mixins/hook"
export default {
  mixins: [page, hook],
  data() {
    return {
      title: "",
      content: ""
    }
  },
  computed: {},
  onLoad() {
    this.handleInit()
  },
  methods: {
    handleInit() {
      setTimeout(() => {
        const richtext = uni.$getCache("richtext")
        if (richtext) {
          this.title = richtext.title
          this.content = richtext.content

          if (this.title) {
            uni.setNavigationBarTitle({ title: this.title })
          }
        }
      }, 300)
    }
  }
}
</script>

<style lang="scss" scoped></style>
